﻿<?xml version="1.0" encoding="utf-8" ?>
<xs:schema
    targetNamespace="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0"
    elementFormDefault="qualified"
    xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:annotation>
    <xs:documentation>
      <!-- _locID_text="Description" _locComment="This string is displayed as a Intellisense tooltip. {Placeholder='XmlSiteMapProvider', 'SiteMap'}" -->MvcSiteMapProvider SiteMap File Schema
    </xs:documentation>
  </xs:annotation>

  <xs:complexType name="mvcSiteMapNodeType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="mvcSiteMapNode" type="mvcSiteMapNodeType" />
    </xs:choice>
    <xs:attributeGroup ref="urlNodeAttributes" />
    <xs:attributeGroup ref="providerNodeAttributes" />
    <xs:attributeGroup ref="fileNodeAttributes" />
    <xs:attributeGroup ref="frequencyNodeAttributes" />
    <xs:anyAttribute processContents="skip" />
  </xs:complexType>

  <xs:complexType name="mvcSiteMapType">
    <xs:choice minOccurs="0" maxOccurs="1">
      <xs:element name="mvcSiteMapNode" type="mvcSiteMapNodeType"/>
    </xs:choice>
    <xs:attributeGroup ref="siteMapAttributes" />
  </xs:complexType>

  <xs:element name="mvcSiteMap" type="mvcSiteMapType" />

  <xs:attributeGroup name="urlNodeAttributes">
    <xs:attribute name="key" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          (autogenerated) The unique identifier for the node.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="url" type="xs:anyURI" use="optional">
      <xs:annotation>
        <xs:documentation>
          (autogenerated based on routes) The URL represented by the node.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="route" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          Can optionally be specified to bind the node URL generation to a specific route.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="title" type="xs:string" use="required">
      <xs:annotation>
        <xs:documentation>
          The title of the node.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="description" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          Description of the node.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="area" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          The MVC area for the sitemap node. If not specified, it will be inherited from a node higher in the hierarchy.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="controller" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          The MVC controller for the sitemap node. Case-sensitive! If not specified, it will be inherited from a node higher in the hierarchy.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="action" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          The MVC action method for the sitemap node. If not specified, it will be inherited from a node higher in the hierarchy.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="roles" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          Comma-separated list of roles allowed to access the node and its child nodes.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="resourceKey" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          Optional resource key.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="clickable" type="xs:boolean" use="optional">
      <xs:annotation>
        <xs:documentation>
          Is the node clickable or just a grouping node? Default is true.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="inheritedRouteParameters" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          Optional. Route parameters that should be inherited from the parent sitemap node. This is not a replacement for the SiteMapPreserveRouteDataAttribute.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="dynamicNodeProvider" type="xs:string" use="optional" >
      <xs:annotation>
        <xs:documentation>
          A class name implementing MvcSiteMapProvider.Extensibility.IDynamicNodeProvider and providing dynamic nodes for the site map.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="urlResolver" type="xs:string" use="optional" >
      <xs:annotation>
        <xs:documentation>
          Class that will be used to generate URLs for sitemap nodes.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="visibility" type="xs:string" use="optional" >
      <xs:annotation>
        <xs:documentation>
          Example from demo: visibility="SiteMapPathHelper,!*"
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="visibilityProvider" type="xs:string" use="optional" >
      <xs:annotation>
        <xs:documentation>
          Class that will be used to determine visibility for a sitemap node.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="targetFrame" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          Optional target frame for the node link.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="imageUrl" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          Optional image to be shown by supported HtmlHelpers.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="preservedRouteParameters" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          Optional preserved route parameter names (= values that will be used from the current request route).
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:attributeGroup name="fileNodeAttributes">
    <xs:attribute name="siteMapFile" type="xs:string" use="optional" />
    <xs:attribute name="securityTrimmingEnabled" type="small_boolean_Type" default="false" />
  </xs:attributeGroup>

  <xs:attributeGroup name="providerNodeAttributes">
    <xs:attribute name="provider" type="xs:string" use="optional" />
  </xs:attributeGroup>

  <xs:attributeGroup name="frequencyNodeAttributes">
    <xs:attribute name="lastModifiedDate" type="xs:dateTime" use="optional">
      <xs:annotation>
        <xs:documentation>
          Last modified date for the node.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="changeFrequency" type="changefrequency_type" use="optional" default="Undefined" >
      <xs:annotation>
        <xs:documentation>
          Change frequency for the node.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="updatePriority" type="updatepriority_type" default="Undefined" use="optional">
      <xs:annotation>
        <xs:documentation>
          Update priority for the node.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:attributeGroup name="siteMapAttributes">
    <xs:attribute name="enableLocalization" type="small_boolean_Type" default="false" use="optional" />
  </xs:attributeGroup>

  <xs:simpleType name="small_boolean_Type">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="false" />
      <xs:enumeration value="true" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="changefrequency_type">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="Undefined" />
      <xs:enumeration value="Always" />
      <xs:enumeration value="Never" />
      <xs:enumeration value="Hourly" />
      <xs:enumeration value="Daily" />
      <xs:enumeration value="Weekly" />
      <xs:enumeration value="Monthly" />
      <xs:enumeration value="Yearly" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="updatepriority_type">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="Undefined" />
      <xs:enumeration value="Automatic" />
      <xs:enumeration value="Low" />
      <xs:enumeration value="Normal" />
      <xs:enumeration value="High" />
      <xs:enumeration value="Critical" />

      <xs:enumeration value="Absolute_000" />
      <xs:enumeration value="Absolute_010" />
      <xs:enumeration value="Absolute_020" />
      <xs:enumeration value="Absolute_030" />
      <xs:enumeration value="Absolute_040" />
      <xs:enumeration value="Absolute_050" />
      <xs:enumeration value="Absolute_060" />
      <xs:enumeration value="Absolute_070" />
      <xs:enumeration value="Absolute_080" />
      <xs:enumeration value="Absolute_090" />
      <xs:enumeration value="Absolute_100" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>